package com.ws.hw_student.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.StringUtils;
import com.ws.hw_student.system.entity.SysRole;
import com.ws.hw_student.system.entity.SysUser;
import com.ws.hw_student.system.entity.SysUserRole;
import com.ws.hw_student.system.mapper.SysRoleMapper;
import com.ws.hw_student.system.service.ISysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ws.hw_student.system.service.ISysUserRoleService;
import com.ws.hw_student.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xyf
 * @since 2025-04-02
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {

    SysRoleMapper sysRoleMapper;
    @Autowired
    ISysUserRoleService sysUserRoleService;

@Override
public Page<SysRole> queryRolePage(Page<SysRole> page, String roleName) {
    LambdaQueryWrapper<SysRole> queryWrapper = new LambdaQueryWrapper<>();
    if(StringUtils.isNotBlank(roleName)){
        queryWrapper.like(SysRole::getRoleName,roleName);
    }
    return this.page(page,queryWrapper);
}
}
